package com.touka.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.touka.entity.Category;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface CategoryMapper extends BaseMapper<Category> {
  @Select("select * from category where name =#{name}")
  Category getByName(String name);

  @Update("update category set is_deleted =0,sort=#{sort} where id=#{id}")
  void updateIsDeleted(Long id, Integer sort);
}
